﻿<%@ Page Title="" Language="C#" MasterPageFile="~/adminpages/MasterPageAdmin.master" AutoEventWireup="true" CodeFile="ManageStaff.aspx.cs" Inherits="adminpages_ManageStaff" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="sta_ID" DataSourceID="SqlDataSourceStaff" AllowPaging="True" AllowSorting="True" CellPadding="4" ForeColor="#333333" GridLines="None" Width="100%">
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        <Columns>
            <asp:CommandField ShowDeleteButton="True" />
            <asp:BoundField DataField="sta_ID" HeaderText="ID" InsertVisible="False" ReadOnly="True" SortExpression="sta_ID" />
            <asp:BoundField DataField="sta_username" HeaderText="username" SortExpression="sta_username" />
            <asp:BoundField DataField="sta_fullname" HeaderText="fullname" SortExpression="sta_fullname" />
            <asp:BoundField DataField="sta_employeenumber" HeaderText="employeenumber" SortExpression="sta_employeenumber" />
            <asp:BoundField DataField="sta_specification" HeaderText="specification" SortExpression="sta_specification" />
            <asp:BoundField DataField="ad_email" HeaderText="email" SortExpression="ad_email" />
        </Columns>
        <EditRowStyle BackColor="#999999" />
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#E9E7E2" />
        <SortedAscendingHeaderStyle BackColor="#506C8C" />
        <SortedDescendingCellStyle BackColor="#FFFDF8" />
        <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSourceStaff" runat="server" ConnectionString="<%$ ConnectionStrings:EnviromentSurvey_S3ConnectionString %>" DeleteCommand="DELETE FROM [StaffAccount] WHERE [sta_ID] = @sta_ID" InsertCommand="INSERT INTO [StaffAccount] ([sta_username], [sta_fullname], [sta_employeenumber], [sta_specification], [ad_email]) VALUES (@sta_username, @sta_fullname, @sta_employeenumber, @sta_specification, @ad_email)" SelectCommand="SELECT [sta_ID], [sta_username], [sta_fullname], [sta_employeenumber], [sta_specification], [ad_email] FROM [StaffAccount]" UpdateCommand="UPDATE [StaffAccount] SET [sta_username] = @sta_username, [sta_fullname] = @sta_fullname, [sta_employeenumber] = @sta_employeenumber, [sta_specification] = @sta_specification, [ad_email] = @ad_email WHERE [sta_ID] = @sta_ID">
        <DeleteParameters>
            <asp:Parameter Name="sta_ID" Type="Int32" />
        </DeleteParameters>
        <InsertParameters>
            <asp:Parameter Name="sta_username" Type="String" />
            <asp:Parameter Name="sta_fullname" Type="String" />
            <asp:Parameter Name="sta_employeenumber" Type="String" />
            <asp:Parameter Name="sta_specification" Type="String" />
            <asp:Parameter Name="ad_email" Type="String" />
        </InsertParameters>
        <UpdateParameters>
            <asp:Parameter Name="sta_username" Type="String" />
            <asp:Parameter Name="sta_fullname" Type="String" />
            <asp:Parameter Name="sta_employeenumber" Type="String" />
            <asp:Parameter Name="sta_specification" Type="String" />
            <asp:Parameter Name="ad_email" Type="String" />
            <asp:Parameter Name="sta_ID" Type="Int32" />
        </UpdateParameters>
    </asp:SqlDataSource>
</asp:Content>

